﻿using JetBrains.Annotations;
using SqlSugar;
using Volo.Abp.Domain.Entities;

namespace Acme.BookStore.Bass
{
    [SugarTable("Bas")]
    public class Bas : Entity
    {
        public Bas()
        { }

        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        [SugarColumn(Length = 64)]
        public string Code { get; set; }

        public string Name { get; set; }

        public override object[] GetKeys()
        {
            return new object[] { Id, Code };
        }

        internal Bas ChangeCode([NotNull] string code)
        {
            Code = code;
            return this;
        }
    }
}